﻿


$.MGJ.AppraiseList = [];
(function () {
    var _this = $.MGJ.AppraiseList;
    $.extend($.MGJ.AppraiseList, {  
        Dialog_feedbackObj: null,
        Dialog_feedback: function (obj) {
            var id = $(obj).attr("ApID");

            this.Dialog_feedbackObj = $.L.dialog({
               
                url: ACTION_URL("feedback", "AntiFake"),
                title: "评价反馈",
                width: 800,
                height: 'auto',
                callback: function () {
                },
                buttons: {
                    "button_save": {
                        type: 'primary',
                        text: '提交',
                        click: function () {
                            var bootstrapValidator = $("#form-Feedback").data('bootstrapValidator').validate();
                            if (bootstrapValidator.isValid()) {
                                $.MGJ.AppraiseList.Ajax_FeedbackList(id);
                            }
                            else {
                                $.L.msgError("请检查数据格式！");
                            };
                        }
                    },
                    "button_cancel": {
                        type: 'default',
                        text: '取消',
                        click: 'MODALMISS'
                    }
                }
            });

        },
    });
})(jQuery);

(function () {
    var _index = 1;
    var _this = $.MGJ.AppraiseList;
    $.extend($.MGJ.AppraiseList, {
        //分页
        Ajax_PagerList: function (pageIndex) {
            _index = pageIndex;
            window.SearchKey = removeSpace($("#wsearch").val());
            $.L.ajaxHandle({
                url: ACTION_URL("CommentPagerList", "AntiFake"),
                data: {
                    wsearch: window.SearchKey,
                    pageIndex: pageIndex,
                    pageSize: 10
                },
                success: function (response) {
                    $("#AppraiseListTable").L_bindingDataList(response);
                    $(".IsConformed").each(function () {

                        if ($(this).html() == "true") {
                            $(this).html("真")
                        }
                        else if ($(this).html() == "false") {
                            $(this).html("假")
                        }

                    })
                }
            });
        },
        //删除
        Ajax_DelAppraiseList: function (obj) {
            $.L.msgConfirm("确认删除该记录?", function () {
                 var id = $(obj).attr("ApID");
                $.L.ajaxHandle({
                    url: ACTION_URL("DelAppraiseList", "AntiFake") + "?id=" + id,
                    data: { id: id },
                    success: function (response) {
                        if (response > 0) {
                            $.L.msgSuccess("操作成功！");                    
                            _this.Ajax_PagerList(_index);
                       
                        }
                    }
                });
            })
      
        },
        //反馈
        Ajax_FeedbackList: function (id) {
            $('#CommentID').val(id);

                $.L.ajaxHandle({
                    url: ACTION_URL("FeedbackList", "AntiFake"),
                    data: $("#form-Feedback").serialize(),
                    type:'POST',
                    success: function (response) {
                
                        if (response > 0) {
                            _this.Dialog_feedbackObj.close();
                            $.L.msgSuccess("操作成功！");                      
                        }
                        else {
                            $.L.msgSuccess("操作失败！");
                        }
                    }
                });
            },

    });
})(jQuery);
(function () {
    var _this = $.MGJ.AppraiseList;
    $.extend($.MGJ.AppraiseList, {
    });
})(jQuery);
